using System.Net;

namespace iPhOwa.Exchange
{
	/// <summary>
	/// Contains all the necesary information to authentication to Exchange.
	/// </summary>
	[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Owa")]
	public sealed class OwaSession
	{
		private readonly AuthenticationType authenticationType;
		private readonly CookieContainer cookies;
		private readonly string domain;
		private readonly string password;
		private readonly string userName;

		/// <summary>
		/// Constructor.
		/// </summary>
		public OwaSession(AuthenticationType authenticationType, string userName, string password, string domain, CookieContainer cookies)
		{
			this.password = password;
			this.cookies = cookies;
			this.authenticationType = authenticationType;
			this.userName = userName;
			this.domain = domain;
		}

		/// <summary>
		/// Users domain.
		/// </summary>
		public string Domain
		{
			get { return domain; }
		}

		/// <summary>
		/// OwaSession username.
		/// </summary>
		public string UserName
		{
			get { return userName; }
		}

		/// <summary>
		/// Session password.
		/// </summary>
		public string Password
		{
			get { return password; }
		}

		/// <summary>
		/// Session cookies, used for forms-based authentication.
		/// </summary>
		public CookieContainer Cookies
		{
			get { return cookies; }
		}

		/// <summary>
		/// Authentication type.
		/// </summary>
		public AuthenticationType AuthenticationType
		{
			get { return authenticationType; }
		}
	}
}